public class Evolution {
    int a, b, c;
    double x1, x2;

    boolean solve() {
        boolean result = true;
        if ((b * b - (4 * a * c)) > 0) {
            this.x1 =( (-b + Math.sqrt(b * b - (4 * a * c))) / (2 * a));
            this.x2 = ((-b - Math.sqrt(b * b - (4 * a * c))) / (2 * a));
        } else if ((b * b - (4 * a * c)) == 0) {
            this.x1 = ((-b - Math.sqrt(b * b - (4 * a * c))) / (2 * a));
        } else if ((b * b - (4 * a * c)) < 0){
            System.out.println("此方程式无解");
            result = false;
        }
        return result;
    }

    void print() {
        if((b*b-4*a*c) >0){
            System.out.println("此方程式有解");
            System.out.println("x1 = " + this.x1);
            System.out.println("x2 = " + this.x2);
        } else if ((b*b-4*a*c) ==0) {
            System.out.println("x有唯一值 : " + this.x1);

        }
    }
    void input(int a, int b, int c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }
}
